package org.lansir.af.ui;

import org.lansir.af.reminder.AlarmService;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;

/**
 * 用于开机启动AlarmService
 * 
 * @author 蓝智宏
 * 
 */
public class ActivityFairyReceiver extends BroadcastReceiver {

	@Override
	public void onReceive(Context context, Intent intent) {
		if ((context != null) && (intent != null)) {
			if (intent.getAction().equals(Intent.ACTION_BOOT_COMPLETED)) {
				try {
					context.startService(new Intent(context, AlarmService.class));
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
		}
	}

}
